{%- include snippets/locale-to-string.html locale=site.data.locale.ARTICLE_LIST_DATE_FORMAT -%}
{%- assign _format = __return -%}
{%- assign _post_count = site.posts | size -%}
{%- if _post_count < 1 -%}
{}
{%- else -%}
{
  {%- for _post in site.posts -%}
    {%- assign _currentdate = _post.date | date: '%Y' -%}
    {%- if _currentdate != _date -%}
      {%- unless forloop.first -%}],{%- endunless -%}
      "{{ _currentdate }}":[{
      {%- assign _date = _currentdate -%}
    {%- else -%},{
    {%- endif -%}
      "key":"{{ forloop.index }}","title":"{{ _post.title | url_encode }}","tags":[
    {%- for _tag in _post.tags -%}
      "{{ _tag | url_encode }}" {%- unless forloop.last -%},{%- endunless -%}
    {%- endfor -%}
    {%- include snippets/prepend-baseurl.html path=_post.url -%}
    {%- assign _url = __return -%}
      ],"url":"{{ _url | url_encode }}","date":"{{ _post.date | date: _format }}"}
  {%- endfor -%}
]}
{%- endif -%}